#define _CRT_SECURE_NO_WARNINGS 1

#include<unordered_map>
#include<iostream>

using namespace std;

class Solution
{
public:
    void sortColors(vector<int>& nums)
    {
        unordered_map<int, int> mp;
        for (auto& e : nums)
        {
            mp[e]++;
        }
        int n = 0;
        for (int i = 0; i < nums.size(); i++)
        {
            if (mp[n] != 0 && mp.count(n))
            {
                nums[i] = n;
                mp[n]--;
            }
            else
            {
                n++;
                i--;
            }
        }

    }
};


int main()
{
    return 0;
}